﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Shared/Site.Master" AutoEventWireup="true"
    CodeBehind="KH_NhanPhong.aspx.cs" Inherits="Hotel_Admin.KH_NhanPhong" %>

<%@ Register Assembly="Hotel.Controls" Namespace="Hotel.Controls" TagPrefix="hotel" %>
<%@ Register Src="us_HelpStatus.ascx" TagName="us_HelpStatus" TagPrefix="uc1" %>
<%@ Register Src="us_HelpStatusOfPhieuDat.ascx" TagName="us_HelpStatusOfPhieuDat"
    TagPrefix="uc2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .helper
        {
            float: right;
            padding-right: 20px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="crmcontainer">
        <asp:UpdatePanel runat="server" ID="upInfor" UpdateMode="Conditional">
            <ContentTemplate>
                <table class="crmtable">
                    <tbody>
                        <tr>
                            <td class="crmcell right">
                                CMND
                            </td>
                            <td>
                                <div class="left width-200">
                                    <asp:TextBox ID="txtCMND" runat="server"></asp:TextBox>
                                </div>
                                <div class="left">
                                    <div class="right">
                                        Tên khách hàng</div>
                                </div>
                                <div class="left">
                                    <asp:TextBox runat="server" ID="txtTenKhachHang" />
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td class="crmcell right">
                                Tình trạng phiếu đặt phòng
                            </td>
                            <td>
                                <div class="left width-200">
                                    <asp:DropDownList runat="server" ID="ddlTinhTrangDon" />
                                </div>
                                <div class="left">
                                    <div class="right">
                                    </div>
                                </div>
                                <div class="left">
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                &nbsp;
                            </td>
                            <td>
                                <asp:Button ID="btnFilter" CssClass="btnGui" Text="Lọc" runat="server" OnClick="btnFilter_Click" />
                                <asp:Button ID="btnSave" CssClass="btnGui hidden" Text="Lưu" runat="server" OnClick="btnSave_Click" />
                                <asp:Button ID="btnDelete" CssClass="btnGui hidden" Text="Xóa" runat="server" OnClick="btnDelete_Click" />
                                <asp:Button ID="btnHuy" CssClass="btnGui" Text="Hủy" runat="server" OnClick="btnHuy_Click" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                &nbsp;
                            </td>
                            <td class="helper">
                                <uc2:us_HelpStatusOfPhieuDat ID="us_HelpStatusOfPhieuDat1" runat="server" />
                            </td>
                        </tr>
                    </tbody>
                </table>
            </ContentTemplate>
        </asp:UpdatePanel>
        <asp:UpdatePanel runat="server" ID="upChiTietPhieuDat" UpdateMode="Conditional">
            <ContentTemplate>
                <div id="divDetails" class="crmcontainer" runat="server" visible="false">
                    <div class="_divheader">
                        <asp:Label runat="server" ID="lbTenPhieuDat" /></div>
                    <hotel:Grid ID="gvDetail" runat="server" UseCustomPager="true" 
                        OnRowCommand="gvDetail_RowCommand" onrowdatabound="gvDetail_RowDataBound">
                        <PagerSettings FirstPageText="phòng" PageButtonCount="2" />
                        <Columns>
                           <asp:TemplateField HeaderStyle-CssClass="checkbox">
                               
                                <ItemTemplate>
                                    <%# Eval("MaPhieuDat") %>'
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Phòng" HeaderStyle-Width="20%">
                                <ItemTemplate>
                                    <%# Eval("PHONG.TenPhong") + "-" + Eval("PHONG.LOAI_PHONG.TenLoaiPhong") + "-" + Eval("PHONG.HANG_PHONG.TenHangPhong")%>
                                </ItemTemplate>
                                <ItemStyle ForeColor="Red" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Tên khách hàng ">
                                <ItemTemplate>
                                    <asp:TextBox runat="server" ID="txtTenKhachHang" Width="90%" ReadOnly='<%# !Eval("MaTinhTrang").ToString().Equals("1") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Chứng minh" HeaderStyle-Width="20%">
                                <ItemTemplate>
                                    <asp:TextBox runat="server" ID="txtChungMinh" Width="90%"  ReadOnly='<%# !Eval("MaTinhTrang").ToString().Equals("1") %>'/>
                                </ItemTemplate>
                                <ItemStyle Font-Bold="True" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Đơn giá" HeaderStyle-Width="10%">
                                <ItemTemplate>
                                    <%# String.Format("{0:0,0}",Eval("DonGia")) %>
                                </ItemTemplate>
                                <ItemStyle Font-Bold="True" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Tùy chọn " HeaderStyle-Width="18%">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lnkBtnID" runat="server" CommandArgument='<%# Eval("MaChiTietPhieuDat") %>' CommandName="DatPhongItem"
                                        CssClass="link" Text="Nhận phòng" Enabled='<%# Eval("MaTinhTrang").ToString().Equals("1") %>'></asp:LinkButton>|
                                    <asp:LinkButton ID="linkHuyPhong" runat="server" CommandArgument='<%# Eval("MaChiTietPhieuDat") %>' CommandName="HuyPhongItem"
                                        CssClass="link" Text="Hủy phòng"  Enabled='<%# Eval("MaTinhTrang").ToString().Equals("1") %>'></asp:LinkButton>|
                                </ItemTemplate>
                                <ItemStyle Font-Bold="True" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Tình trạng " HeaderStyle-Width="10%">
                            <ItemTemplate>
                                <asp:Panel runat="server" ID="status" ForeColor="White" HorizontalAlign="Center"
                                    Height="20px">
                                    <%# Eval("TRANG_THAI_CHI_TIET_PHIEU_DAT.TenTrangThai")%>
                                </asp:Panel>
                            </ItemTemplate>
                            <ItemStyle Font-Bold="True" />
                        </asp:TemplateField>
                        </Columns>
                    </hotel:Grid>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
        <br />
        <asp:UpdatePanel runat="server" ID="upGird" UpdateMode="Conditional">
            <ContentTemplate>
                <hotel:Grid ID="gvList" runat="server" UseCustomPager="true" OnRowCommand="gvList_RowCommand"
                    OnRowDataBound="gvList_RowDataBound">
                    <PagerSettings FirstPageText="phiếu đặt phòng " PageButtonCount="2" />
                    <Columns>
                        <asp:TemplateField HeaderStyle-CssClass="checkbox">
                            <HeaderTemplate>
                                <input id="chkAllTop" title="Chọn hết / Bỏ chọn hết" name="chkAllTop" type="checkbox"
                                    onclick="CheckAllItems(this);" />
                            </HeaderTemplate>
                            <ItemTemplate>
                                <input id="Id" runat="server" type="hidden" value='<%# Eval("MaPhieuDat") %>' />
                                <input name="listIds" type="checkbox" value='<%# Eval("MaPhieuDat") %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Mã phiếu đặt phòng " HeaderStyle-Width="18%">
                            <ItemTemplate>
                                <asp:LinkButton ID="lnkBtnID" runat="server" CommandArgument='<%# Eval("MaPhieuDat") %>'
                                    CommandName="EditItem" CssClass="link" Text='<%# Eval("MaPhieuDat") %>'></asp:LinkButton>
                            </ItemTemplate>
                            <ItemStyle Font-Bold="True" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Tên khách hàng" HeaderStyle-Width="10%">
                            <ItemTemplate>
                                <%# Eval("HoTen") %>
                            </ItemTemplate>
                            <ItemStyle Font-Bold="True" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Chứng minh nhân dân" HeaderStyle-Width="10%">
                            <ItemTemplate>
                                <%# Eval("CMND") %>
                            </ItemTemplate>
                            <ItemStyle Font-Bold="True" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Ngày đặt" HeaderStyle-Width="15%">
                            <ItemTemplate>
                                <%# Eval("NgayDat") %>
                            </ItemTemplate>
                            <ItemStyle Font-Bold="True" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Số phòng" HeaderStyle-Width="15%">
                            <ItemTemplate>
                                <%# Eval("SoLuong") %>
                            </ItemTemplate>
                            <ItemStyle Font-Bold="True" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Tình trạng " HeaderStyle-Width="10%">
                            <ItemTemplate>
                                <asp:Panel runat="server" ID="status" ForeColor="White" HorizontalAlign="Center"
                                    Height="20px">
                                    <%# Eval("TRANG_THAI_PHIEU_DAT.TenTrangThai") %>
                                </asp:Panel>
                            </ItemTemplate>
                            <ItemStyle Font-Bold="True" />
                        </asp:TemplateField>
                    </Columns>
                </hotel:Grid>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
